package servlets;

public class ServletUtilities {

	public static final String DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";

	public static String headWithTitle(String title) {
		return (DOCTYPE + "\n<html>\n<head><title>" + title + "</title></head>\n");
	}
	
	public static String holeFormular(String vorname,
			String nachname, String ort) {
		return("<body><h2>Bitte geben Sie Ihre Daten ein:</h2>"
				+ "<form method=\"post\" action=\"http://localhost:8080/SZ/Abo\">"
				+ "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\">"
				+ "<tr><td>Vorname:</td>"
				+ "<td><input type=\"text\" size=\"20\" name=\"vorname\" value=\""
				+ vorname
				+ "\" /></td>"
				+ "</tr><tr><td>Nachname: </td>"
				+ "<td><input type=\"text\" size=\"20\" name=\"nachname\" value=\""
				+ nachname
				+ "\" /></td></tr>"
				+ "<tr><td>Ort: </td><td><input type=\"text\" size=\"20\" name=\"ort\" value=\""
				+ ort
				+ "\" /></td></tr>"
				+ "</table>"
				+"<input type=\"checkbox\" name=\"abo\" value=\"Weser Kurier\"> Weser Kurier<br />"
				+"<input type=\"checkbox\" name=\"abo\" value=\"NWZ\"> NWZ<br />"
				+"<input type=\"checkbox\" name=\"abo\" value=\"Bild\"> Bild-Zeitung<br />"
				+ "<br /><input type=\"submit\" value=\"abschicken\" /></form></body></html>");
	}

	public static String holeFormular() {
		return holeFormular("", "", "");
	}
}
